/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author nivri
 */
@Entity
@Table(name = "permisos_usuarios")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "PermisosUsuarios.findAll", query = "SELECT p FROM PermisosUsuarios p"),
    @NamedQuery(name = "PermisosUsuarios.findById", query = "SELECT p FROM PermisosUsuarios p WHERE p.id = :id"),
    @NamedQuery(name = "PermisosUsuarios.findByEdi", query = "SELECT p FROM PermisosUsuarios p WHERE p.edi = :edi"),
    @NamedQuery(name = "PermisosUsuarios.findByDel", query = "SELECT p FROM PermisosUsuarios p WHERE p.del = :del"),
    @NamedQuery(name = "PermisosUsuarios.findByViw", query = "SELECT p FROM PermisosUsuarios p WHERE p.viw = :viw"),
    //@NamedQuery(name = "PermisosUsuarios.findByfkusu", query = "SELECT p FROM PermisosUsuarios p WHERE p.fk_usuarios = :fk_usuarios"),
    @NamedQuery(name = "PermisosUsuarios.findByCreat", query = "SELECT p FROM PermisosUsuarios p WHERE p.creat = :creat"),
    @NamedQuery(name = "PermisosUsuarios.findByRolUser", query = "SELECT p FROM PermisosUsuarios p WHERE p.rolUser = :rolUser")})
public class PermisosUsuarios implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 36)
    @Column(name = "id")
    private String id;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "edi")
    private String edi;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "del")
    private String del;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "viw")
    private String viw;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "creat")
    private String creat;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 45)
    @Column(name = "rol_user")
    private String rolUser;
    @JoinColumn(name = "fk_usuarios", referencedColumnName = "id")
    @ManyToOne(optional = false)
    private Usuarios fkUsuarios;

    public PermisosUsuarios() {
    }

    public PermisosUsuarios(String id) {
        this.id = id;
    }

    public PermisosUsuarios(String id, String edi, String del, String viw, String creat, String rolUser) {
        this.id = id;
        this.edi = edi;
        this.del = del;
        this.viw = viw;
        this.creat = creat;
        this.rolUser = rolUser;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getEdi() {
        return edi;
    }

    public void setEdi(String edi) {
        this.edi = edi;
    }

    public String getDel() {
        return del;
    }

    public void setDel(String del) {
        this.del = del;
    }

    public String getViw() {
        return viw;
    }

    public void setViw(String viw) {
        this.viw = viw;
    }

    public String getCreat() {
        return creat;
    }

    public void setCreat(String creat) {
        this.creat = creat;
    }

    public String getRolUser() {
        return rolUser;
    }

    public void setRolUser(String rolUser) {
        this.rolUser = rolUser;
    }

    public Usuarios getFkUsuarios() {
        return fkUsuarios;
    }

    public void setFkUsuarios(Usuarios fkUsuarios) {
        this.fkUsuarios = fkUsuarios;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PermisosUsuarios)) {
            return false;
        }
        PermisosUsuarios other = (PermisosUsuarios) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.PermisosUsuarios[ id=" + id + " ]";
    }
    
}
